const { ccclass, property } = cc._decorator;
import TargetBase from './TargetBase';

@ccclass
export default class RefreshAim extends cc.Component {
    _TargetBase: TargetBase = null;
    _type: number = 0;
    _isRefresh: boolean = true;
    _isAttack: boolean = true;

    init() {
        let aniim = this.node.getComponent(cc.Animation);
        if (this._isRefresh)
            aniim.on('finished', this.onLastFrame, this);
        aniim.play();
    }
    onLastFrame() {
        this.node.x = this.node.y = 0;
        this.node.opacity = 225;
        this._TargetBase.deleteRefreshNode(this._type, this._isRefresh, this._isAttack, this.node);
    }
}
